<?php

namespace App\Modules\Company\Repository\Impl;

use App\Modules\Company\Model\CompanyOemModel;
use App\Modules\Company\Repository\CompanyRepository;
use App\Modules\Company\Request\CompanyIndexRequest;
use App\Modules\Company\Vo\CompanyIndexVO;

class CompanyRepositoryImpl implements CompanyRepository
{
    public function index(CompanyIndexRequest $request): array
    {
        $oem = CompanyOemModel::paginate($request->page_size, ['*'], 'page', $request->page);
        return (new CompanyIndexVO($oem, $oem->items()))->toArray();
    }
}